package com.appspot.chooserepository.shared;

import java.util.Date;

public class RepositoryUser {	
	
	private String user;
	private String repository;
	private Date lastUpdated;

	public RepositoryUser(String user, String repository, Date lastUpdated) {
		this.user = user;
		this.repository = repository;
		this.lastUpdated = lastUpdated;
	}

	public String getUser() {
		return user;
	}

	public String getRepository() {
		return repository;
	}

	public Date getLastUpdated() {
		return lastUpdated;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof RepositoryUser) {
			RepositoryUser otherRepositoryUser = (RepositoryUser) obj;
			boolean check = otherRepositoryUser.getRepository().equals(repository);
			check = check && otherRepositoryUser.getUser().equals(user);
			check = check && otherRepositoryUser.getLastUpdated().equals(lastUpdated);
			return check;
		}
		return false;
	}
}
